<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>箭头函数</title>
</head>
<body>
	<script>
		function fn(a,b){
			return a+b
		}
		console.log(fn(10,20));
		demo=(a,b)=>{
			return a+b
		}
		console.log(demo(10,20));
	</script>
	<h2>箭头函数</h2>
    <script>
    	let h2=document.querySelector('h2')
    	h2.onclick=function(){
    		console.log(h2)
    		setTimeout(()=>{
    			this.innerHTML='<span style="color:red;">箭头函数</span>'
    		},2000)
    	}
    </script>
    <script>
    	res=(...arr)=>{
    		let num=0;
    		for(let i=0;i<arr.length;i++){
    			num+=arr[i]
    		}
    		return num
    	}
    	console.log(res(5,6,8,9,9,52,85,258,86,25,63,65,5,4,6));
    </script>
</body>
</html>